package com.ruoyi.web.controller.admin.topicManagement.teacher;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.web.domain.vo.QueryTopicDetailVo;
import com.ruoyi.web.service.teacher.topicInfo.DepartmentService;
import com.ruoyi.web.service.teacher.topicInfo.TopicService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Anonymous
@Api(tags={"课题信息"})
@RestController
@RequestMapping("/InformationManage/Topic")
public class TopicController {

    @Autowired
    private TopicService topicService;

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/departmentList")
    @ApiOperation(value = "获取所有专业")
    public R getDepartmentList() {
        return departmentService.getDepartmentList();
    }



    @GetMapping("/topicList/{PageNum}/{PageSize}")
    @ApiOperation(value = "课题信息-查询列表", notes = "按提供的页码和显示条数分页查询学生的课题信息列表")
    @ApiImplicitParams({@ApiImplicitParam(name = "PageNum", value = "当前页码", dataType = "Integer", required = true, paramType = "path"),
            @ApiImplicitParam(name = "PageSize", value = "显示页数", dataType = "Integer", required = true, paramType = "path")})
    public R getTopicList(
            @PathVariable("PageNum") Integer pageNum,
            @PathVariable("PageSize") Integer PageSize) {

        return topicService.getTopicList(pageNum, PageSize);
    }



    @PostMapping("/topicInfo")
    @ApiOperation(value = "查看课题详情", notes = "查看某学生的课题详情")
    public R getTopicInfo(@RequestBody QueryTopicDetailVo queryTopicDetailVo) {
        return topicService.getTopicInfoById(queryTopicDetailVo.getId(), queryTopicDetailVo.getInstructor2());
    }
}

